// 简单关卡生成算法
export function generateLevel(level = 1) {
  // 游戏区域大小
  const width = 600, height = 400
  // 锤子初始位置
  const hammer = { x: 80, y: height - 60 }
  // 随机生成气球
  const balloonCount = Math.min(5 + Math.floor(level / 2), 10)
  const balloons = []
  for (let i = 0; i < balloonCount; i++) {
    balloons.push({
      x: 120 + Math.random() * (width - 180),
      y: 60 + Math.random() * (height - 180)
    })
  }
  // 随机生成障碍物
  const obstacleCount = Math.floor(level / 2)
  const obstacles = []
  for (let i = 0; i < obstacleCount; i++) {
    obstacles.push({
      x: 120 + Math.random() * (width - 180),
      y: 60 + Math.random() * (height - 180)
    })
  }
  return { hammer, balloons, obstacles, width, height }
} 